<!doctype html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]>    <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"><!--<![endif]-->
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<title><g:layoutTitle default="Grails"/></title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<link rel="shortcut icon" href="${resource(dir: 'images', file: 'favicon.ico')}" type="image/x-icon">
		<link rel="apple-touch-icon" href="${resource(dir: 'images', file: 'apple-touch-icon.png')}">
		<link rel="apple-touch-icon" sizes="114x114" href="${resource(dir: 'images', file: 'apple-touch-icon-retina.png')}">
		<link rel="stylesheet" href="${resource(dir: 'css', file: 'main.css')}" type="text/css">
		<link rel="stylesheet" href="${resource(dir: 'css', file: 'mobile.css')}" type="text/css">

        <!-- auctionhaus css styles -->
        <link rel="stylesheet" href="${resource(dir: 'css', file: 'auctionhaus.css')}" type="text/css">

        <script type="text/javascript" src="${resource(dir: 'js', file: 'auctionhaus.js')}" ></script>
        		<g:layoutHead/>
        <r:layoutResources />

        <script type="text/JavaScript">
            window.onload = checkLogin;

            // see if the user is logged in, and adjust the login/logout info in the header accordingly
            function checkLogin()
            {
                var customerLoggedIn = "${session.customerLoggedIn}";
                var createCustomerHref = document.getElementById("createCustomerLink");
                var loginHref = document.getElementById("loginLink");

                if(customerLoggedIn)
                { // someone is logged in
                    // hide the Login link
                    document.getElementById("loginLink").style.display="none";

                    // hide the Register link
                    document.getElementById("createCustomerLink").style.display="none";

                    // show which user is logged in
                    document.getElementById("loggedInName").textContent = customerLoggedIn;
                }
                else
                { // NO ONE is logged in
                    // hide the Logout link
                    document.getElementById("logoutLink").style.display="none";

                    // hide the My Listings link
                    document.getElementById("myListingsLink").style.display="none";

                    // don't show anything where logged in user would be
                    document.getElementById("loggedInName").textContent = "";
                }
            }
        </script>
	</head>
	<body>
        <div id="auctionhaus_header">
            <div id="createCustomer">
                <g:link elementId="createCustomerLink" url="http://localhost:8080/AuctionHaus/customer/create">Register</g:link>
                <g:link elementId="myListingsLink" url="http://localhost:8080/AuctionHaus/listing/mylistings">My Listings</g:link>
            </div>
            <div id="login">
                <g:link elementId="loginLink" url="http://localhost:8080/AuctionHaus/customer/login">Login</g:link>
                <g:link elementId="logoutLink" url="http://localhost:8080/AuctionHaus/customer/logout">Logout</g:link>
                <div id="loggedInName">Hello Guest</div>
            </div>
            <div id="logoText">AuctionHaus!</div>
        </div>
        <!--<div id="grailsLogo" role="banner"><a href="http://grails.org"><img src="${resource(dir: 'images', file: 'grails_logo.png')}" alt="Grails"/></a></div>-->
		<g:layoutBody/>
		<div class="footer" role="contentinfo"></div>
		<div id="spinner" class="spinner" style="display:none;"><g:message code="spinner.alt" default="Loading&hellip;"/></div>
		<g:javascript library="application"/>
        <r:layoutResources />
	</body>
</html>